#include "cpu/exec/helper.h"

#define DATA_BYTE 4

make_helper(ret){//刚开始在模板里写make_helper(ret)报错说重定义,无法解决,所以不写模板了
    cpu.eip = swaddr_read(cpu.esp,DATA_BYTE, R_SS) - 1;
    cpu.esp += DATA_BYTE;
    print_asm("ret");
    return 1;
}
make_helper(ret_i){
    uint16_t imm = instr_fetch(eip+1, 2);
    cpu.eip = swaddr_read(cpu.esp,DATA_BYTE, R_SS) - 3;
    cpu.esp += (DATA_BYTE + imm);
    print_asm_template1();
    return 3;
}

#undef DATA_BYTE
